home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / ShutDown.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  2.5 KB  |  109 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ShutDown.p
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ShutDown;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __SHUTDOWN__}
  30. {$SETC __SHUTDOWN__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ShutDownIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __MIXEDMODE__}
  43. {$I MixedMode.p}
  44. {$ENDC}
  45.  
  46. {$PUSH}
  47. {$ALIGN MAC68K}
  48. {$LibExport+}
  49.  
  50. CONST
  51.     sdOnPowerOff                = 1;                            {call procedure before power off.}
  52.     sdOnRestart                    = 2;                            {call procedure before restart.}
  53.     sdOnUnmount                    = 4;                            {call procedure before unmounting.}
  54.     sdOnDrivers                    = 8;                            {call procedure before closing drivers.}
  55.     sdRestartOrPower            = 3;                            {call before either power off or restart.}
  56.  
  57. TYPE
  58.     {
  59.         ShutDwnProcPtr uses register based parameters on the 68k and cannot
  60.         be written in or called from a high-level language without the help of
  61.         mixed mode or assembly glue.
  62.  
  63.         In:
  64.          => shutDownStage    D0.W
  65.     }
  66.     ShutDwnProcPtr = Register68kProcPtr;  { register PROCEDURE ShutDwn(shutDownStage: INTEGER); }
  67.     ShutDwnUPP = UniversalProcPtr;
  68.  
  69. CONST
  70.     uppShutDwnProcInfo = $00001002; { Register PROCEDURE (2 bytes in D0); }
  71.  
  72. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  73.     {$IFC NOT GENERATINGCFM }
  74.     INLINE $2E9F;
  75.     {$ENDC}
  76.  
  77. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  78.     {$IFC NOT GENERATINGCFM}
  79.     {To be implemented:  Glue to move parameters into registers.}
  80.     {$ENDC}
  81.  
  82. PROCEDURE ShutDwnPower;
  83.     {$IFC NOT GENERATINGCFM}
  84.     INLINE $3F3C, $0001, $A895;
  85.     {$ENDC}
  86. PROCEDURE ShutDwnStart;
  87.     {$IFC NOT GENERATINGCFM}
  88.     INLINE $3F3C, $0002, $A895;
  89.     {$ENDC}
  90. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  91.     {$IFC NOT GENERATINGCFM}
  92.     INLINE $3F3C, $0003, $A895;
  93.     {$ENDC}
  94. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  95.     {$IFC NOT GENERATINGCFM}
  96.     INLINE $3F3C, $0004, $A895;
  97.     {$ENDC}
  98.  
  99. {$ALIGN RESET}
  100. {$POP}
  101.  
  102. {$SETC UsingIncludes := ShutDownIncludes}
  103.  
  104. {$ENDC} {__SHUTDOWN__}
  105.  
  106. {$IFC NOT UsingIncludes}
  107.  END.
  108. {$ENDC}
  109.